import QtQuick 2.0
import QtQuick.Layouts 1.1

Rectangle {
    width: 400
    height: 300

    ColumnLayout {
        anchors.fill: parent

        Test_TitleBar {
        }

        Rectangle {
            id: rectangle1
            x: 89
            y: 158
            width: 200
            height: 200
            color: "#ffffff"
            Layout.fillHeight: true
            Layout.fillWidth: true

            GridView {
                id: gridView1
                clip: true
                anchors.fill: parent
                delegate: Item {
                    //id: item
                    //anchors.centerIn: parent
                   // x: 5
                    //height: 150
                    //color: "red"
                    //border.width: 5
                   // border.color: "black"
                    width: gridView1.cellWidth;
                   height: gridView1.cellHeight

                    Column {
                         anchors.centerIn: parent
                        Rectangle {
                            width: gridView1.cellWidth -20
                            height: gridView1.cellWidth -20
                            color: colorCode
                        }

                        Text {
                            x: 5
                            text: name
                            font.bold: true
                            anchors.horizontalCenter: parent.horizontalCenter
                        }
                        spacing: 5
                    }
                }
                cellWidth: parent.width / 3
                //cellWidth: 170
                cellHeight: cellWidth + 50

                model: ListModel {
                    ListElement {
                        name: "Grey"
                        colorCode: "grey"
                    }

                    ListElement {
                        name: "Red"
                        colorCode: "red"
                    }

                    ListElement {
                        name: "Blue"
                        colorCode: "blue"
                    }

                    ListElement {
                        name: "Green"
                        colorCode: "green"
                    }
                }
            }
        }





    }
    // anchors.fill: parent
}

